package com.tairan.chapter.web.service;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

public interface IRoleService {

    @Cacheable(value = "roles", key = "targetClass.name+methodName")
//    @Cacheable(value = "roles")
    List<String> list();

//    @CacheEvict(value = "roles", allEntries = true)
    @CacheEvict(value = "roles", key = "targetClass.name+'list'")
    void createOrUpdate(String user);

    @CacheEvict(value = "roles", key = "targetClass.name+'list'")
    void delete(String user);

}
